﻿.card section[role=main] {
    display: -ms-grid;
    -ms-grid-columns: 300px 1fr;
    -ms-grid-rows: 1fr;
    margin-left: 40px;
}

#control {
    -ms-grid-column: 1;
    height: 100%;
    width: 100%; 
    /*border: 1px solid red;*/ 
    font-size: 32px;
}

    #control > div {
        margin-bottom: 30px;
    }

#display {
    -ms-grid-column: 2;
    height: 100%;
    width: 100%;  
    margin-top: -100px;
    /*border: 1px solid red;*/ 
}

.row {
    width: 100%;
    height: 130px;
    /*border: 1px solid gray;*/ 
}

    .row > div {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
        margin-left: 10px;
        float: left;
        border: 2px solid gray;
    }

        .row > div.selected {
            border: 2px solid black !important;
        }

#orientations > div {
    width: 60px;
    height: 60px; 
    background-size: 100% 100%;
    margin-bottom: 10px;
    margin-left: 10px;
    float: left;
    border: 2px solid rgb(241, 241, 241);
}

.icon-portrait {
    background: url("../../images/portrait.png") no-repeat center;
}


.icon-landscape {
    background: url("../../images/landscape.png") no-repeat center;
}

#card {
    margin: auto;
    border: 1px solid gray;
    position: relative;
}

    #card.portrait {
        width: 500px;
        height: 700px;
    }
    
    #card.landscape {
        margin-top: 100px;
        width: 700px;
        height: 500px;
    }

    #card > img {
        width: 100%;
        height: 100%;
        position: relative;
        z-index: 1;
    }

    #card > div.window {
        position: absolute;
        /*border: 1px solid red;*/
        overflow:hidden;

        display:-ms-flexbox;
        -ms-flex-align:center;
        -ms-flex-direction:column;
        -ms-flex-pack:center;
    }

    #card > p.text {
        position: absolute;
        border: 2px solid red;
        overflow:hidden;
        display: block;
        z-index: 2;
        margin: 0;
        padding: 0;
    }

.window img.tooWide {
    max-height: 100%;
    width: auto;
}

.window img.tooHigh {
    max-width: 100%;
    height: auto;
}
